package com.sl.au.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.BidRecord;


public interface BidRecordRepository extends JpaRepository<BidRecord, String> {
	/// 投标情况记录查询
	@Query(" select b from BidRecord b where b.bid.id=?1")
	Page<BidRecord> findBidRecord(String id,Pageable pageable);
	
	//投标情况记录条数

	@Query(" select count(b) from BidRecord b where b.bid.id=?1")
	Long getCount(String id);
	
   //删除与投标相关的投标情况记录bidId
	@Transactional
	@Modifying  
	@Query("delete from BidRecord b where b.bid.id=?1 ")
	public void deleteBidRecord(String bidId);
	


}
